{smcl}
{com}{sf}{ul off}{txt}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}/Users/thomassommerer/Dropbox/JoP/Effects_of_legitimacy_log.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res} 4 Dec 2024, 09:29:18

{com}. do "/var/folders/vk/h9lb5ngs589d0v1zd71z_yhw0000gn/T//SD53030.000000"
{txt}
{com}. 
. 
. ******************************************************************************************************************
. ************************* 4 December 2024 ******************************************************** Author TS *****
. ********** Do-file ***********************************************************************************************
. **** Effects of Popular Legitimacy on International Organizations: An Elite Survey Experiment ********************
. ********** NOTE: please adapt syntax to your working directory ***** Replace: /Users/thomassommerer/Dropbox/JoP/ *
. *******************  STATA 18.0 SE MAC ***************************************************************************
. 
. 
. ************************ Overview **************
. 
. ***** 1. T-tests & Export of Stata output ******
. ***** 2. Editing of the dataset based on t-tests
. ***** 3. Figures 1-5, main text  ***************
. ***** 4. Appendix Figures B1-B7 & Tables *******
. 
. ************************************************
. 
. 
. 
. 
. 
. **************************************************************
. ******* 1. T-tests and export of Stata output ****************
. **************************************************************
. 
. 
. *************************+ Note: results including p-values stored in "EffectsofLegitimacy_ttest.dta", see  below ****
. 
. *** T-test for Figure 1
. 
. ********* Three DVs: Resources, Independence, Authority 
. 
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta", clear
{txt}
{com}. sort id
{txt}
{com}. 
. quietly ttest q23_1_*, by(exp_g)
{txt}
{com}. matrix ttest= (r(mu_1),(r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1)))), (r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1)))  , r(p)     ), r(mu_2), (r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2)))), (r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2)))   , r(p)  ) )
{txt}
{com}. clear 
{txt}
{com}. svmat ttest, names(Res)
{txt}number of observations will be reset to 1
Press any key to continue, or Break to abort
{p}
Number of observations ({bf:_N}) was 0,
now 1.
{p_end}

{com}. save "/Users/thomassommerer/Dropbox/JoP/ttest_r1.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_r1.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_r1.dta{rm}
saved
{p_end}

{com}. 
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta"
{txt}
{com}. sort id
{txt}
{com}. quietly ttest q23_2_*, by(exp_g)
{txt}
{com}. matrix ttest= (r(mu_1),(r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1)))), (r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1)))  , r(p)     ), r(mu_2), (r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2)))), (r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2)))   , r(p)  ) )
{txt}
{com}. clear 
{txt}
{com}. svmat ttest, names(Indep)
{txt}number of observations will be reset to 1
Press any key to continue, or Break to abort
{p}
Number of observations ({bf:_N}) was 0,
now 1.
{p_end}

{com}. save "/Users/thomassommerer/Dropbox/JoP/ttest_i1.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_i1.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_i1.dta{rm}
saved
{p_end}

{com}. 
. 
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta"
{txt}
{com}. sort id
{txt}
{com}. quietly ttest q23_3_*, by(exp_g)
{txt}
{com}. matrix ttest= (r(mu_1),(r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1)))), (r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1)))  , r(p)     ), r(mu_2), (r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2)))), (r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2)))   , r(p)  ) )
{txt}
{com}. clear 
{txt}
{com}. svmat ttest, names(Auth)
{txt}number of observations will be reset to 1
Press any key to continue, or Break to abort
{p}
Number of observations ({bf:_N}) was 0,
now 1.
{p_end}

{com}. save "/Users/thomassommerer/Dropbox/JoP/ttest_a1.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_a1.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_a1.dta{rm}
saved
{p_end}

{com}. 
. 
. *** Ttest for Figure 2
. 
. ********* Three DVs: Resources, Independence, Authority - subsample by pre-treatment confidence in WHO (lowest two categories merged) ***
. 
. 
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta"
{txt}
{com}. sort id
{txt}
{com}. quietly ttest q23_1_res if q18==4 , by(exp_group)
{txt}
{com}. matrix ttest= (r(mu_1),(r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1)))), (r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1)))  , r(p)     ), r(mu_2), (r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2)))), (r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2)))   , r(p)  ) )
{txt}
{com}. clear 
{txt}
{com}. svmat ttest, names(Res)
{txt}number of observations will be reset to 1
Press any key to continue, or Break to abort
{p}
Number of observations ({bf:_N}) was 0,
now 1.
{p_end}

{com}. save "/Users/thomassommerer/Dropbox/JoP/ttest_r2.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_r2.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_r2.dta{rm}
saved
{p_end}

{com}. 
. 
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta"
{txt}
{com}. sort id
{txt}
{com}. quietly ttest q23_1_res if q18==3 , by(exp_group)
{txt}
{com}. matrix ttest= (r(mu_1),(r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1)))), (r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1)))  , r(p)     ), r(mu_2), (r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2)))), (r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2)))   , r(p)  ) )
{txt}
{com}. clear 
{txt}
{com}. svmat ttest, names(Res)
{txt}number of observations will be reset to 1
Press any key to continue, or Break to abort
{p}
Number of observations ({bf:_N}) was 0,
now 1.
{p_end}

{com}. save "/Users/thomassommerer/Dropbox/JoP/ttest_r3.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_r3.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_r3.dta{rm}
saved
{p_end}

{com}. 
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta"
{txt}
{com}. sort id
{txt}
{com}. quietly ttest q23_1_res if q18==2 | q18==1 , by(exp_group)
{txt}
{com}. matrix ttest= (r(mu_1),(r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1)))), (r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1)))  , r(p)     ), r(mu_2), (r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2)))), (r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2)))   , r(p)  ) )
{txt}
{com}. clear 
{txt}
{com}. svmat ttest, names(Res)
{txt}number of observations will be reset to 1
Press any key to continue, or Break to abort
{p}
Number of observations ({bf:_N}) was 0,
now 1.
{p_end}

{com}. save "/Users/thomassommerer/Dropbox/JoP/ttest_r4.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_r4.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_r4.dta{rm}
saved
{p_end}

{com}. 
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta"
{txt}
{com}. sort id
{txt}
{com}. quietly ttest q23_2_indep if q18==4 , by(exp_group)
{txt}
{com}. matrix ttest= (r(mu_1),(r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1)))), (r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1)))  , r(p)     ), r(mu_2), (r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2)))), (r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2)))   , r(p)  ) )
{txt}
{com}. clear 
{txt}
{com}. svmat ttest, names(Indep)
{txt}number of observations will be reset to 1
Press any key to continue, or Break to abort
{p}
Number of observations ({bf:_N}) was 0,
now 1.
{p_end}

{com}. save "/Users/thomassommerer/Dropbox/JoP/ttest_i2.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_i2.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_i2.dta{rm}
saved
{p_end}

{com}. 
. 
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta"
{txt}
{com}. sort id
{txt}
{com}. quietly ttest q23_2_indep if q18==3 , by(exp_group)
{txt}
{com}. matrix ttest= (r(mu_1),(r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1)))), (r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1)))  , r(p)     ), r(mu_2), (r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2)))), (r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2)))   , r(p)  ) )
{txt}
{com}. clear 
{txt}
{com}. svmat ttest, names(Indep)
{txt}number of observations will be reset to 1
Press any key to continue, or Break to abort
{p}
Number of observations ({bf:_N}) was 0,
now 1.
{p_end}

{com}. save "/Users/thomassommerer/Dropbox/JoP/ttest_i3.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_i3.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_i3.dta{rm}
saved
{p_end}

{com}. 
. 
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta"
{txt}
{com}. sort id
{txt}
{com}. quietly ttest q23_2_indep if q18==2 | q18==1 , by(exp_group)
{txt}
{com}. matrix ttest= (r(mu_1),(r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1)))), (r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1)))  , r(p)     ), r(mu_2), (r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2)))), (r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2)))   , r(p)  ) )
{txt}
{com}. clear 
{txt}
{com}. svmat ttest, names(Indep)
{txt}number of observations will be reset to 1
Press any key to continue, or Break to abort
{p}
Number of observations ({bf:_N}) was 0,
now 1.
{p_end}

{com}. save "/Users/thomassommerer/Dropbox/JoP/ttest_i4.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_i4.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_i4.dta{rm}
saved
{p_end}

{com}. 
. 
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta"
{txt}
{com}. sort id
{txt}
{com}. quietly ttest q23_3_auth if q18==4 , by(exp_group)
{txt}
{com}. matrix ttest= (r(mu_1),(r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1)))), (r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1)))  , r(p)     ), r(mu_2), (r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2)))), (r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2)))   , r(p)  ) )
{txt}
{com}. clear 
{txt}
{com}. svmat ttest, names(Auth)
{txt}number of observations will be reset to 1
Press any key to continue, or Break to abort
{p}
Number of observations ({bf:_N}) was 0,
now 1.
{p_end}

{com}. save "/Users/thomassommerer/Dropbox/JoP/ttest_a2.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_a2.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_a2.dta{rm}
saved
{p_end}

{com}. 
. 
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta"
{txt}
{com}. sort id
{txt}
{com}. quietly ttest q23_3_auth if q18==3 , by(exp_group)
{txt}
{com}. matrix ttest= (r(mu_1),(r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1)))), (r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1)))  , r(p)     ), r(mu_2), (r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2)))), (r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2)))   , r(p)  ) )
{txt}
{com}. clear 
{txt}
{com}. svmat ttest, names(Auth)
{txt}number of observations will be reset to 1
Press any key to continue, or Break to abort
{p}
Number of observations ({bf:_N}) was 0,
now 1.
{p_end}

{com}. save "/Users/thomassommerer/Dropbox/JoP/ttest_a3.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_a3.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_a3.dta{rm}
saved
{p_end}

{com}. 
. 
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta"
{txt}
{com}. sort id
{txt}
{com}. quietly ttest q23_3_auth if q18==2 | q18==1 , by(exp_group)
{txt}
{com}. matrix ttest= (r(mu_1),(r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1)))), (r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1)))  , r(p)     ), r(mu_2), (r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2)))), (r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2)))   , r(p)  ) )
{txt}
{com}. clear 
{txt}
{com}. svmat ttest, names(Auth)
{txt}number of observations will be reset to 1
Press any key to continue, or Break to abort
{p}
Number of observations ({bf:_N}) was 0,
now 1.
{p_end}

{com}. save "/Users/thomassommerer/Dropbox/JoP/ttest_a4.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_a4.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_a4.dta{rm}
saved
{p_end}

{com}. 
. 
. ***** Ttest for Figure 3 ********************************************
. ********* Three DVs: Resources, Independence, Authority - subsample by ideology (left/right) ***
. 
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta"
{txt}
{com}. sort id
{txt}
{com}. quietly ttest q23_1_res if ideology==1 , by(exp_group)
{txt}
{com}. matrix  ttest= (r(mu_1),(r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1)))), (r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1)))  , r(p)     ), r(mu_2), (r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2)))), (r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2)))   , r(p)  ) )
{txt}
{com}. clear 
{txt}
{com}. svmat ttest, names(Res)
{txt}number of observations will be reset to 1
Press any key to continue, or Break to abort
{p}
Number of observations ({bf:_N}) was 0,
now 1.
{p_end}

{com}. save "/Users/thomassommerer/Dropbox/JoP/ttest_r5.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_r5.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_r5.dta{rm}
saved
{p_end}

{com}. 
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta"
{txt}
{com}. sort id
{txt}
{com}. quietly ttest q23_1_res if ideology==2 , by(exp_group)
{txt}
{com}. matrix  ttest= (r(mu_1),(r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1)))), (r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1)))  , r(p)     ), r(mu_2), (r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2)))), (r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2)))   , r(p)  ) )
{txt}
{com}. clear 
{txt}
{com}. svmat ttest, names(Res)
{txt}number of observations will be reset to 1
Press any key to continue, or Break to abort
{p}
Number of observations ({bf:_N}) was 0,
now 1.
{p_end}

{com}. save "/Users/thomassommerer/Dropbox/JoP/ttest_r6.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_r6.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_r6.dta{rm}
saved
{p_end}

{com}. 
. 
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta"
{txt}
{com}. sort id
{txt}
{com}. quietly ttest q23_2_indep if ideology==1 , by(exp_group)
{txt}
{com}. matrix  ttest= (r(mu_1),(r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1)))), (r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1)))  , r(p)     ), r(mu_2), (r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2)))), (r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2)))   , r(p)  ) )
{txt}
{com}. clear 
{txt}
{com}. svmat ttest, names(Indep)
{txt}number of observations will be reset to 1
Press any key to continue, or Break to abort
{p}
Number of observations ({bf:_N}) was 0,
now 1.
{p_end}

{com}. save "/Users/thomassommerer/Dropbox/JoP/ttest_i5.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_i5.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_i5.dta{rm}
saved
{p_end}

{com}. 
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta"
{txt}
{com}. sort id
{txt}
{com}. quietly ttest q23_2_indep if ideology==2 , by(exp_group)
{txt}
{com}. matrix  ttest= (r(mu_1),(r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1)))), (r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1)))  , r(p)     ), r(mu_2), (r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2)))), (r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2)))   , r(p)  ) )
{txt}
{com}. clear 
{txt}
{com}. svmat ttest, names(Indep)
{txt}number of observations will be reset to 1
Press any key to continue, or Break to abort
{p}
Number of observations ({bf:_N}) was 0,
now 1.
{p_end}

{com}. save "/Users/thomassommerer/Dropbox/JoP/ttest_i6.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_i6.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_i6.dta{rm}
saved
{p_end}

{com}. 
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta"
{txt}
{com}. sort id
{txt}
{com}. quietly ttest q23_3_auth if ideology==1 , by(exp_group)
{txt}
{com}. matrix  ttest= (r(mu_1),(r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1)))), (r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1)))  , r(p)     ), r(mu_2), (r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2)))), (r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2)))   , r(p)  ) )
{txt}
{com}. clear 
{txt}
{com}. svmat ttest, names(Auth)
{txt}number of observations will be reset to 1
Press any key to continue, or Break to abort
{p}
Number of observations ({bf:_N}) was 0,
now 1.
{p_end}

{com}. save "/Users/thomassommerer/Dropbox/JoP/ttest_a5.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_a5.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_a5.dta{rm}
saved
{p_end}

{com}. 
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta"
{txt}
{com}. sort id
{txt}
{com}. quietly ttest q23_3_auth if ideology==2 , by(exp_group)
{txt}
{com}. matrix  ttest= (r(mu_1),(r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1)))), (r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1)))  , r(p)     ), r(mu_2), (r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2)))), (r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2)))   , r(p)  ) )
{txt}
{com}. clear 
{txt}
{com}. svmat ttest, names(Auth)
{txt}number of observations will be reset to 1
Press any key to continue, or Break to abort
{p}
Number of observations ({bf:_N}) was 0,
now 1.
{p_end}

{com}. save "/Users/thomassommerer/Dropbox/JoP/ttest_a6.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_a6.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_a6.dta{rm}
saved
{p_end}

{com}. 
. 
. **** Ttest  Figure B4   **************
. *** Composite index based on mean of Resources, Independence, Authority ***
. 
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta"
{txt}
{com}. sort id
{txt}
{com}. quietly ttest q23_123_index, by(exp_group)
{txt}
{com}. matrix  ttest= (r(mu_1),(r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1)))), (r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1)))  , r(p)     ), r(mu_2), (r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2)))), (r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2)))   , r(p)  ) )
{txt}
{com}. clear 
{txt}
{com}. svmat ttest, names(Index)
{txt}number of observations will be reset to 1
Press any key to continue, or Break to abort
{p}
Number of observations ({bf:_N}) was 0,
now 1.
{p_end}

{com}. save "/Users/thomassommerer/Dropbox/JoP/ttest_index.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_index.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_index.dta{rm}
saved
{p_end}

{com}. 
. 
. **** Ttest Figure B5 ***********************
. 
. ********* Three DVs: Resources, Independence, Authority - subsample by pre-treatment  attitudes on international cooperation (lowest two categories merged) ***
. 
. 
. 
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta"
{txt}
{com}. sort id
{txt}
{com}. quietly ttest q23_1_res if q16==4 , by(exp_group)
{txt}
{com}. matrix  ttest= (r(mu_1),(r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1)))), (r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1)))  , r(p)     ), r(mu_2), (r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2)))), (r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2)))   , r(p)  ) )
{txt}
{com}. clear 
{txt}
{com}. svmat ttest, names(Res)
{txt}number of observations will be reset to 1
Press any key to continue, or Break to abort
{p}
Number of observations ({bf:_N}) was 0,
now 1.
{p_end}

{com}. save "/Users/thomassommerer/Dropbox/JoP/ttest_r7.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_r7.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_r7.dta{rm}
saved
{p_end}

{com}. 
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta"
{txt}
{com}. sort id
{txt}
{com}. quietly ttest q23_1_res if q16==3 , by(exp_group)
{txt}
{com}. matrix  ttest= (r(mu_1),(r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1)))), (r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1)))  , r(p)     ), r(mu_2), (r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2)))), (r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2)))   , r(p)  ) )
{txt}
{com}. clear 
{txt}
{com}. svmat ttest, names(Res)
{txt}number of observations will be reset to 1
Press any key to continue, or Break to abort
{p}
Number of observations ({bf:_N}) was 0,
now 1.
{p_end}

{com}. save "/Users/thomassommerer/Dropbox/JoP/ttest_r8.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_r8.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_r8.dta{rm}
saved
{p_end}

{com}. 
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta"
{txt}
{com}. sort id
{txt}
{com}. quietly ttest q23_1_res if q16==2 | q16==1 , by(exp_group)
{txt}
{com}. matrix  ttest= (r(mu_1),(r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1)))), (r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1)))  , r(p)     ), r(mu_2), (r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2)))), (r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2)))   , r(p)  ) )
{txt}
{com}. clear 
{txt}
{com}. svmat ttest, names(Res)
{txt}number of observations will be reset to 1
Press any key to continue, or Break to abort
{p}
Number of observations ({bf:_N}) was 0,
now 1.
{p_end}

{com}. save "/Users/thomassommerer/Dropbox/JoP/ttest_r9.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_r9.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_r9.dta{rm}
saved
{p_end}

{com}. 
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta"
{txt}
{com}. sort id
{txt}
{com}. quietly ttest q23_2_indep if q16==4 , by(exp_group)
{txt}
{com}. matrix  ttest= (r(mu_1),(r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1)))), (r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1)))  , r(p)     ), r(mu_2), (r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2)))), (r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2)))   , r(p)  ) )
{txt}
{com}. clear 
{txt}
{com}. svmat ttest, names(Indep)
{txt}number of observations will be reset to 1
Press any key to continue, or Break to abort
{p}
Number of observations ({bf:_N}) was 0,
now 1.
{p_end}

{com}. save "/Users/thomassommerer/Dropbox/JoP/ttest_i7.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_i7.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_i7.dta{rm}
saved
{p_end}

{com}. 
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta"
{txt}
{com}. sort id
{txt}
{com}. quietly ttest q23_2_indep if q16==3 , by(exp_group)
{txt}
{com}. matrix  ttest= (r(mu_1),(r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1)))), (r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1)))  , r(p)     ), r(mu_2), (r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2)))), (r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2)))   , r(p)  ) )
{txt}
{com}. clear 
{txt}
{com}. svmat ttest, names(Indep)
{txt}number of observations will be reset to 1
Press any key to continue, or Break to abort
{p}
Number of observations ({bf:_N}) was 0,
now 1.
{p_end}

{com}. save "/Users/thomassommerer/Dropbox/JoP/ttest_i8.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_i8.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_i8.dta{rm}
saved
{p_end}

{com}. 
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta"
{txt}
{com}. sort id
{txt}
{com}. quietly ttest q23_2_indep if q16==2 | q16==1 , by(exp_group)
{txt}
{com}. matrix  ttest= (r(mu_1),(r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1)))), (r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1)))  , r(p)     ), r(mu_2), (r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2)))), (r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2)))   , r(p)  ) )
{txt}
{com}. clear 
{txt}
{com}. svmat ttest, names(Indep)
{txt}number of observations will be reset to 1
Press any key to continue, or Break to abort
{p}
Number of observations ({bf:_N}) was 0,
now 1.
{p_end}

{com}. save "/Users/thomassommerer/Dropbox/JoP/ttest_i9.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_i9.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_i9.dta{rm}
saved
{p_end}

{com}. 
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta"
{txt}
{com}. sort id
{txt}
{com}. quietly ttest q23_3_auth if q16==4 , by(exp_group)
{txt}
{com}. matrix  ttest= (r(mu_1),(r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1)))), (r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1)))  , r(p)     ), r(mu_2), (r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2)))), (r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2)))   , r(p)  ) )
{txt}
{com}. clear 
{txt}
{com}. svmat ttest, names(Auth)
{txt}number of observations will be reset to 1
Press any key to continue, or Break to abort
{p}
Number of observations ({bf:_N}) was 0,
now 1.
{p_end}

{com}. save "/Users/thomassommerer/Dropbox/JoP/ttest_a7.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_a7.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_a7.dta{rm}
saved
{p_end}

{com}. 
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta"
{txt}
{com}. sort id
{txt}
{com}. quietly ttest q23_3_auth if q16==3 , by(exp_group)
{txt}
{com}. matrix  ttest= (r(mu_1),(r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1)))), (r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1)))  , r(p)     ), r(mu_2), (r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2)))), (r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2)))   , r(p)  ) )
{txt}
{com}. clear 
{txt}
{com}. svmat ttest, names(Auth)
{txt}number of observations will be reset to 1
Press any key to continue, or Break to abort
{p}
Number of observations ({bf:_N}) was 0,
now 1.
{p_end}

{com}. save "/Users/thomassommerer/Dropbox/JoP/ttest_a8.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_a8.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_a8.dta{rm}
saved
{p_end}

{com}. 
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta"
{txt}
{com}. sort id
{txt}
{com}. quietly ttest q23_3_auth if q16==2 | q16==1 , by(exp_group)
{txt}
{com}. matrix  ttest= (r(mu_1),(r(mu_1)-1.96*(r(sd_1)/sqrt(r(N_1)))), (r(mu_1)+1.96*(r(sd_1)/sqrt(r(N_1)))  , r(p)     ), r(mu_2), (r(mu_2)-1.96*(r(sd_2)/sqrt(r(N_2)))), (r(mu_2)+1.96*(r(sd_2)/sqrt(r(N_2)))   , r(p)  ) )
{txt}
{com}. clear 
{txt}
{com}. svmat ttest, names(Auth)
{txt}number of observations will be reset to 1
Press any key to continue, or Break to abort
{p}
Number of observations ({bf:_N}) was 0,
now 1.
{p_end}

{com}. save "/Users/thomassommerer/Dropbox/JoP/ttest_a9.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_a9.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_a9.dta{rm}
saved
{p_end}

{com}. 
. 
. 
. 
. *********************************************
. ***** 2. Editing of the exported dataset ****
. *********************************************
. 
. 
. ********* Integrate multiple result files into common file ***
. 
. 
. use "/Users/thomassommerer/Dropbox/JoP/ttest_r1.dta", clear
{txt}
{com}. append using "/Users/thomassommerer/Dropbox/JoP/ttest_r2.dta""/Users/thomassommerer/Dropbox/JoP/ttest_r3.dta" "/Users/thomassommerer/Dropbox/JoP/ttest_r4.dta" "/Users/thomassommerer/Dropbox/JoP/ttest_r5.dta""/Users/thomassommerer/Dropbox/JoP/ttest_r6.dta" "/Users/thomassommerer/Dropbox/JoP/ttest_r7.dta" "/Users/thomassommerer/Dropbox/JoP/ttest_r8.dta" "/Users/thomassommerer/Dropbox/JoP/ttest_r9.dta"
{txt}
{com}. save "/Users/thomassommerer/Dropbox/JoP/ttest_r.dta"
{txt}{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_r.dta{rm}
saved
{p_end}

{com}. 
. use "/Users/thomassommerer/Dropbox/JoP/ttest_i1.dta", clear
{txt}
{com}. append using "/Users/thomassommerer/Dropbox/JoP/ttest_i2.dta""/Users/thomassommerer/Dropbox/JoP/ttest_i3.dta" "/Users/thomassommerer/Dropbox/JoP/ttest_i4.dta" "/Users/thomassommerer/Dropbox/JoP/ttest_i5.dta""/Users/thomassommerer/Dropbox/JoP/ttest_i6.dta" "/Users/thomassommerer/Dropbox/JoP/ttest_i7.dta" "/Users/thomassommerer/Dropbox/JoP/ttest_i8.dta" "/Users/thomassommerer/Dropbox/JoP/ttest_i9.dta"
{txt}
{com}. save "/Users/thomassommerer/Dropbox/JoP/ttest_i.dta"
{txt}{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_i.dta{rm}
saved
{p_end}

{com}. 
. use "/Users/thomassommerer/Dropbox/JoP/ttest_a1.dta", clear
{txt}
{com}. append using "/Users/thomassommerer/Dropbox/JoP/ttest_a2.dta""/Users/thomassommerer/Dropbox/JoP/ttest_a3.dta" "/Users/thomassommerer/Dropbox/JoP/ttest_a4.dta" "/Users/thomassommerer/Dropbox/JoP/ttest_a5.dta""/Users/thomassommerer/Dropbox/JoP/ttest_a6.dta" "/Users/thomassommerer/Dropbox/JoP/ttest_a7.dta" "/Users/thomassommerer/Dropbox/JoP/ttest_a8.dta" "/Users/thomassommerer/Dropbox/JoP/ttest_a9.dta"
{txt}
{com}. save "/Users/thomassommerer/Dropbox/JoP/ttest_a.dta"
{txt}{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/ttest_a.dta{rm}
saved
{p_end}

{com}. 
. ***
. 
. use "/Users/thomassommerer/Dropbox/JoP/ttest_r.dta"
{txt}
{com}. merge 1:1 _n using "/Users/thomassommerer/Dropbox/JoP/ttest_i.dta"
{res}
{txt}{col 5}Result{col 33}Number of obs
{col 5}{hline 41}
{col 5}Not matched{col 30}{res}               0
{txt}{col 5}Matched{col 30}{res}               9{txt}  (_merge==3)
{col 5}{hline 41}

{com}. drop _merge
{txt}
{com}. merge 1:1 _n using "/Users/thomassommerer/Dropbox/JoP/ttest_a.dta"
{res}
{txt}{col 5}Result{col 33}Number of obs
{col 5}{hline 41}
{col 5}Not matched{col 30}{res}               0
{txt}{col 5}Matched{col 30}{res}               9{txt}  (_merge==3)
{col 5}{hline 41}

{com}. drop _merge
{txt}
{com}. merge 1:1 _n using "/Users/thomassommerer/Dropbox/JoP/ttest_index.dta"
{res}
{txt}{col 5}Result{col 33}Number of obs
{col 5}{hline 41}
{col 5}Not matched{col 30}{res}               8
{txt}{col 9}from master{col 30}{res}               8{txt}  (_merge==1)
{col 9}from using{col 30}{res}               0{txt}  (_merge==2)

{col 5}Matched{col 30}{res}               1{txt}  (_merge==3)
{col 5}{hline 41}

{com}. drop _merge
{txt}
{com}. save "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_ttest.dta"
{txt}{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_ttest.dta{rm}
saved
{p_end}

{com}. 
. 
. erase "/Users/thomassommerer/Dropbox/JoP/ttest_a.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/ttest_a1.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/ttest_a2.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/ttest_a3.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/ttest_a4.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/ttest_a5.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/ttest_a6.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/ttest_a7.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/ttest_a8.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/ttest_a9.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/ttest_i.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/ttest_i1.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/ttest_i2.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/ttest_i3.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/ttest_i4.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/ttest_i5.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/ttest_i6.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/ttest_i7.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/ttest_i8.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/ttest_i9.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/ttest_r.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/ttest_r1.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/ttest_r2.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/ttest_r3.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/ttest_r4.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/ttest_r5.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/ttest_r6.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/ttest_r7.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/ttest_r8.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/ttest_r9.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/ttest_index.dta"
{txt}
{com}. 
. 
. 
. **************************************************************
. ****** Re-organizing the dataset based on ttest output  ******
. **** Mean, CIs(95), p value ****
. 
. gen id=_n
{txt}
{com}. order id
{txt}
{com}. 
. rename *1 *_mean1
{res}{txt}
{com}. rename *2 *_cilo1
{res}{txt}
{com}. rename *3 *_cihi1
{res}{txt}
{com}. rename *4 *_p1
{res}{txt}
{com}. rename *5 *_mean2
{res}{txt}
{com}. rename *6 *_cilo2
{res}{txt}
{com}. rename *7 *_cihi2
{res}{txt}
{com}. rename *8 *_p2
{res}{txt}
{com}. 
. reshape long Res_mean Res_cilo Res_cihi Res_p Indep_mean Indep_cilo Indep_cihi Indep_p Auth_mean Auth_cilo Auth_cihi Auth_p Index_mean Index_cilo Index_cihi Index_p, i(id) j(treatment)
{txt}(j = 1 2)

Data{col 36}Wide{col 43}->{col 48}Long
{hline 77}
Number of observations     {res}           9   {txt}->   {res}18          
{txt}Number of variables        {res}          33   {txt}->   {res}18          
{txt}j variable (2 values)                     ->   {res}treatment
{txt}xij variables:
                    {res}Res_mean1 Res_mean2   {txt}->   {res}Res_mean
                    Res_cilo1 Res_cilo2   {txt}->   {res}Res_cilo
                    Res_cihi1 Res_cihi2   {txt}->   {res}Res_cihi
                          Res_p1 Res_p2   {txt}->   {res}Res_p
                Indep_mean1 Indep_mean2   {txt}->   {res}Indep_mean
                Indep_cilo1 Indep_cilo2   {txt}->   {res}Indep_cilo
                Indep_cihi1 Indep_cihi2   {txt}->   {res}Indep_cihi
                      Indep_p1 Indep_p2   {txt}->   {res}Indep_p
                  Auth_mean1 Auth_mean2   {txt}->   {res}Auth_mean
                  Auth_cilo1 Auth_cilo2   {txt}->   {res}Auth_cilo
                  Auth_cihi1 Auth_cihi2   {txt}->   {res}Auth_cihi
                        Auth_p1 Auth_p2   {txt}->   {res}Auth_p
                Index_mean1 Index_mean2   {txt}->   {res}Index_mean
                Index_cilo1 Index_cilo2   {txt}->   {res}Index_cilo
                Index_cihi1 Index_cihi2   {txt}->   {res}Index_cihi
                      Index_p1 Index_p2   {txt}->   {res}Index_p
{txt}{hline 77}

{com}. 
. drop id
{txt}
{com}. gen id=_n
{txt}
{com}. order id
{txt}
{com}. 
. label define Treatment 1 "Strong public support for WHO" 2 "Weak public support for WHO"
{txt}
{com}. label values treatment Treatment
{txt}
{com}. 
. gen figure =.
{txt}(18 missing values generated)

{com}. replace figure =1 if id<3
{txt}(2 real changes made)

{com}. replace figure =2 if id>2 & id<9
{txt}(6 real changes made)

{com}. replace figure =3 if id>8 & id<13
{txt}(4 real changes made)

{com}. replace figure =5 if id>12
{txt}(6 real changes made)

{com}. 
. label define Figure 1 "Figure 1" 2 "Figure 2" 3 "Figure 3" 5 "Figure B.5"
{txt}
{com}. label values figure Figure
{txt}
{com}. 
. gen subgroup=.
{txt}(18 missing values generated)

{com}. 
. replace subgroup =1 if id<3
{txt}(2 real changes made)

{com}. replace subgroup =2 if id>2 & id<5
{txt}(2 real changes made)

{com}. replace subgroup =3 if id>4 & id<7
{txt}(2 real changes made)

{com}. replace subgroup =4 if id>6 & id<9
{txt}(2 real changes made)

{com}. replace subgroup =5 if id>8 & id<11
{txt}(2 real changes made)

{com}. replace subgroup =6 if id>10 & id<13
{txt}(2 real changes made)

{com}. replace subgroup =7 if id>12 & id<15
{txt}(2 real changes made)

{com}. replace subgroup =8 if id>14 & id<17
{txt}(2 real changes made)

{com}. replace subgroup =9 if id>16 & id<19
{txt}(2 real changes made)

{com}. 
. label define Subgr 1 "All" 2 "High confidence" 3 "Somewhat high confidence" 4 "Low confidence" 5 "Left" 6 "Right" 7 "Fully agree" 8 "Partially agree" 9 "Disagree"
{txt}
{com}. 
. label values subgroup Subgr
{txt}
{com}. order id treat figure subgroup
{txt}
{com}. 
. label define Reform  2 "Partially oppose reform" 3 "Partially support reform" 4 "Fully support reform"
{txt}
{com}. label values  *_mean Reform
{txt}
{com}. 
. save "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_ttest.dta", replace
{txt}{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_ttest.dta{rm}
saved
{p_end}

{com}. 
. 
. 
. 
. 
. ****************************************************************************************************
. ****************************************************************************************************
. ********** 3. Figures 1-5, main text      **********************************************************
. ****************************************************************************************************
. ****************************************************************************************************
. 
. 
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_ttest.dta", clear
{txt}
{com}. 
. **** Figure 1 *****
. 
. 
. *** Authority 
. 
. twoway (scatter Auth_mean treatment, mcolor(black) msize(medlarge) msymbol(circle)) (rspike Auth_cilo Auth_cihi treatment, lcolor(black))if id>0 & id<3, ytitle(, size(zero)) yline(2 3 4, lwidth(thin) lpattern(solid) lcolor(gs8)) ylabel(2(1)4, labsize(medsmall)angle(horizontal) valuelabel) xtitle(, size(zero))  xscale(range(0.5 2.5)) xlabel(1(1)2, labsize(medsmall) angle(vertical) valuelabel) title(`"Authority"', size(medium) color(black))  legend(off) xsize(2.5) ysize(5) plotregion(lcolor(black))
{res}{txt}
{com}. 
. graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_1a.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_1a.gph} saved

{com}. 
. 
. ***  Resources
. twoway (scatter Res_mean treatment, mcolor(black) msize(medlarge) msymbol(circle)) (rspike Res_cilo Res_cihi treatment, lcolor(black))if id>0 & id<3, ytitle(, size(zero)) yline(2 3 4, lwidth(thin) lpattern(solid) lcolor(gs8)) ylabel(2(1)4, labsize(medsmall)angle(horizontal) valuelabel) xtitle(, size(zero))  xscale(range(0.5 2.5)) xlabel(1(1)2, labsize(medsmall) angle(vertical) valuelabel) title(`"Resources"', size(medium) color(black)) legend(off) xsize(2.5) ysize(5) plotregion(lcolor(black))
{res}{txt}
{com}. 
. graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_1b.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_1b.gph} saved

{com}. 
. *** Independence
. 
. twoway (scatter Indep_mean treatment, mcolor(black) msize(medlarge) msymbol(circle)) (rspike Indep_cilo Indep_cihi treatment, lcolor(black))if id>0 & id<3, ytitle(, size(zero)) yline(2 3 4, lwidth(thin) lpattern(solid) lcolor(gs8)) ylabel(2(1)4, labsize(medsmall) angle(horizontal) valuelabel) xtitle(, size(zero))  xscale(range(0.5 2.5)) xlabel(1(1)2, labsize(medsmall) angle(vertical) valuelabel) title(`"Independence"', size(medium) color(black))  legend(off) xsize(2.5) ysize(5) plotregion(lcolor(black))
{res}{txt}
{com}. 
. graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_1c.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_1c.gph} saved

{com}. 
. 
. ***** Figure 2 Effect of public opinion on support for IO reforms, by level of pre-treatment confidence  ****************
. 
. *** Authority 
. 
. twoway (scatter Auth_mean treatment, mcolor(black) msize(medlarge) msymbol(circle)) (rspike Auth_cilo Auth_cihi treatment, lcolor(black))if id>2 & id<9, ytitle(, size(zero)) yline(2 3 4, lwidth(thin) lpattern(solid) lcolor(gs8)) ylabel(2(1)4, labsize(vsmall) angle(horizontal) valuelabel) xtitle(, size(zero))  xscale(range(0.5 2.5)) xlabel(1(1)2, labsize(vsmall) angle(vertical) valuelabel nogrid) by(, title(`"Authority"', size(medsmall) color(black)) note(`""', size(zero))) by(, legend(off)) by(, graphregion(fcolor(white) lcolor(white))) by(subgroup, cols(3)) subtitle(, fcolor(white) size(vsmall)lcolor(white)) xsize(5.5) ysize(4) plotregion(lcolor(black))
{res}{txt}
{com}. 
. graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_2a.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_2a.gph} saved

{com}. 
. 
. ***  Resources
.  
. twoway (scatter Res_mean treatment, mcolor(black) msize(medlarge) msymbol(circle)) (rspike Res_cilo Res_cihi treatment, lcolor(black))if id>2 & id<9, ytitle(, size(zero)) yline(2 3 4, lwidth(thin) lpattern(solid) lcolor(gs8)) ylabel(2(1)4, labsize(vsmall) angle(horizontal) valuelabel) xtitle(, size(zero))  xscale(range(0.5 2.5)) xlabel(1(1)2, labsize(vsmall) angle(vertical) valuelabel nogrid) by(, title(`"Resources"', size(medsmall) color(black)) note(`""', size(zero))) by(, legend(off)) by(, graphregion(fcolor(white) lcolor(white))) by(subgroup, cols(3)) subtitle(, fcolor(white) size(vsmall)lcolor(white)) xsize(5.5) ysize(4) plotregion(lcolor(black))
{res}{txt}
{com}.  
. graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_2b.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_2b.gph} saved

{com}. 
. 
. *** Independence
. 
.  twoway (scatter Indep_mean treatment, mcolor(black) msize(medlarge) msymbol(circle)) (rspike Indep_cilo Indep_cihi treatment, lcolor(black))if id>2 & id<9, ytitle(, size(zero)) yline(2 3 4, lwidth(thin) lpattern(solid) lcolor(gs8)) ylabel(2(1)4, labsize(vsmall) angle(horizontal) valuelabel) xtitle(, size(zero))  xscale(range(0.5 2.5)) xlabel(1(1)2, labsize(vsmall) angle(vertical) valuelabel nogrid) by(, title(`"Independence"', size(medsmall) color(black)) note(`""', size(zero))) by(, legend(off)) by(, graphregion(fcolor(white) lcolor(white))) by(subgroup, cols(3)) subtitle(, fcolor(white) size(vsmall)lcolor(white)) xsize(5.5) ysize(4) plotregion(lcolor(black))
{res}{txt}
{com}. 
. graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_2c.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_2c.gph} saved

{com}. 
.  
. ****** Figure 3  Effect of public opinion on support for IO reforms, by ideological orientation  *********************
. 
. 
. *** Authority 
. 
. twoway (scatter Auth_mean treatment, mcolor(black) msize(medlarge) msymbol(circle)) (rspike Auth_cilo Auth_cihi treatment, lcolor(black))if id>8 & id<13, ytitle(, size(zero)) yline(2 3 4, lwidth(thin) lpattern(solid) lcolor(gs8)) ylabel(2(1)4, labsize(small) angle(horizontal) valuelabel) xtitle(, size(zero))  xscale(range(0.5 2.5)) xlabel(1(1)2, labsize(small) angle(vertical) valuelabel nogrid) by(, title(`"Authority"', size(medsmall) color(black)) note(`""', size(zero))) by(, legend(off)) by(, graphregion(fcolor(white) lcolor(white))) by(subgroup, cols(3)) subtitle(, fcolor(white) size(small)lcolor(white)) xsize(4) ysize(5.5) plotregion(lcolor(black))
{res}{txt}
{com}. 
. graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_3a.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_3a.gph} saved

{com}. 
. *** Resources
. 
. twoway (scatter Res_mean treatment, mcolor(black) msize(medlarge) msymbol(circle)) (rspike Res_cilo Res_cihi treatment, lcolor(black))if id>8 & id<13, ytitle(, size(zero)) yline(2 3 4, lwidth(thin) lpattern(solid) lcolor(gs8)) ylabel(2(1)4, labsize(small) angle(horizontal) valuelabel) xtitle(, size(zero))  xscale(range(0.5 2.5)) xlabel(1(1)2, labsize(small) angle(vertical) valuelabel nogrid) by(, title(`"Resources"', size(medsmall) color(black)) note(`""', size(zero))) by(, legend(off)) by(, graphregion(fcolor(white) lcolor(white))) by(subgroup, cols(3)) subtitle(, fcolor(white) size(small)lcolor(white)) xsize(4) ysize(5.5) plotregion(lcolor(black))
{res}{txt}
{com}. 
. graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_3b.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_3b.gph} saved

{com}.  
. 
. *** Independence
. 
.  twoway (scatter Indep_mean treatment, mcolor(black) msize(medlarge) msymbol(circle)) (rspike Indep_cilo Indep_cihi treatment, lcolor(black))if id>8 & id<13, ytitle(, size(zero)) yline(2 3 4, lwidth(thin) lpattern(solid) lcolor(gs8)) ylabel(2(1)4, labsize(small) angle(horizontal) valuelabel) xtitle(, size(zero))  xscale(range(0.5 2.5)) xlabel(1(1)2, labsize(small) angle(vertical) valuelabel nogrid) by(, title(`"Independence"', size(medsmall) color(black)) note(`""', size(zero))) by(, legend(off)) by(, graphregion(fcolor(white) lcolor(white))) by(subgroup, cols(3)) subtitle(, fcolor(white) size(small)lcolor(white)) xsize(4) ysize(5.5) plotregion(lcolor(black))
{res}{txt}
{com}. 
.  graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_3c.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_3c.gph} saved

{com}. 
.  
.  
.  ********* Figure 4  Expected consequences of going against public opinion    ***********
.  
.  
. 
. **** Generate binary version of q29* & q31* merging two positive and two negative categories of original variables
.  
.  
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta", clear
{txt}
{com}.  
. 
. gen     q29_1_POopp_foreignpol_bin      =       q29_1_POopp_foreignpol 
{txt}(24 missing values generated)

{com}. gen     q29_2_POopp_domestic_bin        =       q29_2_POopp_domestic 
{txt}(34 missing values generated)

{com}. gen     q29_3_POopp_bipartagree_bin     =       q29_3_POopp_bipartagree 
{txt}(31 missing values generated)

{com}. gen     q29_4_POopp_govsupport_bin      =       q29_4_POopp_govsupport
{txt}(30 missing values generated)

{com}.                                 
. gen     q31_1_POsupp_foreignpol_bin     =       q31_1_POsupp_foreignpol
{txt}(41 missing values generated)

{com}. gen     q31_2_POsupp_domestic_bin       =       q31_2_POsupp_domestic
{txt}(48 missing values generated)

{com}. gen     q31_3_POsupp_bipartagree_bin    =       q31_3_POsupp_bipartagree 
{txt}(50 missing values generated)

{com}. gen     q31_4_POsupp_govsupport_bin     =       q31_4_POsupp_govsupport
{txt}(51 missing values generated)

{com}. 
. 
. 
. recode q*bin (1/2=0) (3/4=1)
{txt}(1,309 changes made to {bf:q29_1_POopp_foreignpol_bin})
(1,299 changes made to {bf:q29_2_POopp_domestic_bin})
(1,302 changes made to {bf:q29_3_POopp_bipartagree_bin})
(1,303 changes made to {bf:q29_4_POopp_govsupport_bin})
(1,292 changes made to {bf:q31_1_POsupp_foreignpol_bin})
(1,285 changes made to {bf:q31_2_POsupp_domestic_bin})
(1,283 changes made to {bf:q31_3_POsupp_bipartagree_bin})
(1,282 changes made to {bf:q31_4_POsupp_govsupport_bin})

{com}. 
. replace q29_1_POopp_foreignpol_bin      =       q29_1_POopp_foreignpol_bin      * 100
{txt}(964 real changes made, 7 to missing)

{com}. replace q29_2_POopp_domestic_bin        =       q29_2_POopp_domestic_bin        * 100
{txt}(738 real changes made, 17 to missing)

{com}. replace q29_3_POopp_bipartagree_bin     =       q29_3_POopp_bipartagree_bin     * 100
{txt}(1,101 real changes made, 14 to missing)

{com}. replace q29_4_POopp_govsupport_bin      =       q29_4_POopp_govsupport_bin      * 100
{txt}(900 real changes made, 13 to missing)

{com}.                                                 
. replace q31_1_POsupp_foreignpol_bin     =       q31_1_POsupp_foreignpol_bin     * 100
{txt}(781 real changes made, 17 to missing)

{com}. replace q31_2_POsupp_domestic_bin       =       q31_2_POsupp_domestic_bin       * 100
{txt}(622 real changes made, 24 to missing)

{com}. replace q31_3_POsupp_bipartagree_bin=   q31_3_POsupp_bipartagree_bin    * 100
{txt}(918 real changes made, 26 to missing)

{com}. replace q31_4_POsupp_govsupport_bin     =       q31_4_POsupp_govsupport_bin     * 100
{txt}(785 real changes made, 27 to missing)

{com}.                                                 
. 
.                                                 
.                                                 
. graph bar (mean) q29_1_POopp_foreignpol_bin q31_1_POsupp_foreignpol_bin, bar(1, fcolor(black) lcolor(black)) bar(2, fcolor(gs11) lcolor(gs11)) bargap(7) ylabel(0(20)100, labsize(small) format(%9.2f) nogrid) title(`"Popular support on other foreign policy issues"', size(small) color(black)) legend(off size(small) position(6)) xsize(5) ysize(7.5) plotregion(lcolor(black))
{res}{txt}
{com}.  graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_4a.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_4a.gph} saved

{com}. 
. 
. graph bar (mean) q29_2_*bin q31_2*bin, bar(1, fcolor(black) lcolor(black)) bar(2, fcolor(gs11) lcolor(gs11)) bargap(7) ylabel(0(20)100, labsize(small) format(%9.2f) nogrid) title(`"Public support on domestic policy issues"', size(small) color(black)) legend(off size(small) position(6)) xsize(5) ysize(7.5) plotregion(lcolor(black))
{res}{txt}
{com}.  graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_4b.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_4b.gph} saved

{com}. 
.  graph bar (mean) q29_3*bin q31_3*bin, bar(1, fcolor(black) lcolor(black)) bar(2, fcolor(gs11) lcolor(gs11)) bargap(7) ylabel(0(20)100, labsize(small) format(%9.2f) nogrid) title(`"Unity in parliament on foreign policy issues"', size(small) color(black)) legend(on order(1 "Public opinon against growing power of IO") size(small) position(6)) xsize(5) ysize(7.5) plotregion(lcolor(black))
{res}{txt}
{com}.  graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_4c.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_4c.gph} saved

{com}. 
.  graph bar (mean) q29_4*bin q31_4*bin, bar(1, fcolor(black) lcolor(black)) bar(2, fcolor(gs11) lcolor(gs11)) bargap(7) ylabel(0(20)100, labsize(small) format(%9.2f) nogrid) title(`"Support for government in public opinion polls"', size(small) color(black)) legend(on order(2 "Public opinon in favor of growing power of IO") size(small) position(6)) xsize(5) ysize(7.5) plotregion(lcolor(black))
{res}{txt}
{com}.  graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_4d.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_4d.gph} saved

{com}. 
. drop q*_bin
{txt}
{com}. 
.  
. save "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta", replace
{txt}{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta{rm}
saved
{p_end}

{com}.  
. 
.  
.  
. ********* Figure 5 Expected consequences of going against public opinion, by IO. *************************************
. 
.  
. **** Generate binary version of q33*-variables, merging two positive and two negative categories ****
.  
.  
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta", clear
{txt}
{com}.  
. gen     q33_1_conseq_EUbin      =       q33_1_conseq_EU         
{txt}(45 missing values generated)

{com}. gen     q33_2_conseq_UNbin      =       q33_2_conseq_UN         
{txt}(46 missing values generated)

{com}. gen     q33_3_conseq_IMFbin     =       q33_3_conseq_IMF                
{txt}(52 missing values generated)

{com}. gen     q33_4_conseq_NATObin    =       q33_4_conseq_NATO               
{txt}(45 missing values generated)

{com}. gen     q33_5_conseq_WHObin     =       q33_5_conseq_WHO                
{txt}(50 missing values generated)

{com}. 
. recode q33*bin (1/2=0) (3/4=1)
{txt}(1,288 changes made to {bf:q33_1_conseq_EUbin})
(1,287 changes made to {bf:q33_2_conseq_UNbin})
(1,281 changes made to {bf:q33_3_conseq_IMFbin})
(1,288 changes made to {bf:q33_4_conseq_NATObin})
(1,283 changes made to {bf:q33_5_conseq_WHObin})

{com}. 
. replace q33_1_conseq_EUbin      =       q33_1_conseq_EUbin      * 100
{txt}(827 real changes made, 14 to missing)

{com}. replace q33_2_conseq_UNbin      =       q33_2_conseq_UNbin      * 100
{txt}(674 real changes made, 15 to missing)

{com}. replace q33_3_conseq_IMFbin     =       q33_3_conseq_IMFbin     * 100
{txt}(354 real changes made, 21 to missing)

{com}. replace q33_4_conseq_NATObin    =       q33_4_conseq_NATObin    * 100
{txt}(657 real changes made, 14 to missing)

{com}. replace q33_5_conseq_WHObin     =       q33_5_conseq_WHObin     *100
{txt}(505 real changes made, 19 to missing)

{com}.                 
. save "/Users/thomassommerer/Dropbox/JoP/Fig5.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/Fig5.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/Fig5.dta{rm}
saved
{p_end}

{com}.                 
. ci means q33_1*bin

{txt}    Variable {c |}        Obs        Mean    Std. err.       [95% conf. interval]
{hline 13}{c +}{hline 63}
q33_1_cons~n {c |}{col 16}{res}     1,288{col 29} 63.12112{col 41} 1.344891{col 57}  60.4827{col 69} 65.75954{txt}

{com}. matrix ci= (r(mean), r(lb), r(ub) )
{txt}
{com}. clear 
{txt}
{com}. svmat ci, names(IOmean)
{txt}number of observations will be reset to 1
Press any key to continue, or Break to abort
{p}
Number of observations ({bf:_N}) was 0,
now 1.
{p_end}

{com}. save "/Users/thomassommerer/Dropbox/JoP/Fig5_EU.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/Fig5_EU.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/Fig5_EU.dta{rm}
saved
{p_end}

{com}. 
. use "/Users/thomassommerer/Dropbox/JoP/Fig5.dta", clear
{txt}
{com}. ci means q33_2*bin

{txt}    Variable {c |}        Obs        Mean    Std. err.       [95% conf. interval]
{hline 13}{c +}{hline 63}
q33_2_cons~n {c |}{col 16}{res}     1,287{col 29} 51.20435{col 41} 1.393874{col 57} 48.46983{col 69} 53.93887{txt}

{com}. matrix ci= (r(mean), r(lb), r(ub) )
{txt}
{com}. clear 
{txt}
{com}. svmat ci, names(IOmean)
{txt}number of observations will be reset to 1
Press any key to continue, or Break to abort
{p}
Number of observations ({bf:_N}) was 0,
now 1.
{p_end}

{com}. save "/Users/thomassommerer/Dropbox/JoP/Fig5_UN.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/Fig5_UN.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/Fig5_UN.dta{rm}
saved
{p_end}

{com}. 
. use "/Users/thomassommerer/Dropbox/JoP/Fig5.dta", clear
{txt}
{com}. ci means q33_3*bin

{txt}    Variable {c |}        Obs        Mean    Std. err.       [95% conf. interval]
{hline 13}{c +}{hline 63}
q33_3_cons~n {c |}{col 16}{res}     1,281{col 29} 25.99532{col 41} 1.225948{col 57} 23.59023{col 69}  28.4004{txt}

{com}. matrix ci= (r(mean), r(lb), r(ub) )
{txt}
{com}. clear 
{txt}
{com}. svmat ci, names(IOmean)
{txt}number of observations will be reset to 1
Press any key to continue, or Break to abort
{p}
Number of observations ({bf:_N}) was 0,
now 1.
{p_end}

{com}. save "/Users/thomassommerer/Dropbox/JoP/Fig5_IMF.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/Fig5_IMF.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/Fig5_IMF.dta{rm}
saved
{p_end}

{com}. 
. use "/Users/thomassommerer/Dropbox/JoP/Fig5.dta", clear
{txt}
{com}. ci means q33_4*bin

{txt}    Variable {c |}        Obs        Mean    Std. err.       [95% conf. interval]
{hline 13}{c +}{hline 63}
q33_4_cons~n {c |}{col 16}{res}     1,288{col 29} 49.92236{col 41} 1.393735{col 57} 47.18812{col 69}  52.6566{txt}

{com}. matrix ci= (r(mean), r(lb), r(ub) )
{txt}
{com}. clear 
{txt}
{com}. svmat ci, names(IOmean)
{txt}number of observations will be reset to 1
Press any key to continue, or Break to abort
{p}
Number of observations ({bf:_N}) was 0,
now 1.
{p_end}

{com}. save "/Users/thomassommerer/Dropbox/JoP/Fig5_NATO.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/Fig5_NATO.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/Fig5_NATO.dta{rm}
saved
{p_end}

{com}. 
. use "/Users/thomassommerer/Dropbox/JoP/Fig5.dta", clear
{txt}
{com}. ci means q33_5*bin

{txt}    Variable {c |}        Obs        Mean    Std. err.       [95% conf. interval]
{hline 13}{c +}{hline 63}
q33_5_cons~n {c |}{col 16}{res}     1,283{col 29} 37.87997{col 41} 1.354804{col 57} 35.22209{col 69} 40.53785{txt}

{com}. matrix ci= (r(mean), r(lb), r(ub) )
{txt}
{com}. clear 
{txt}
{com}. svmat ci, names(IOmean)
{txt}number of observations will be reset to 1
Press any key to continue, or Break to abort
{p}
Number of observations ({bf:_N}) was 0,
now 1.
{p_end}

{com}. save "/Users/thomassommerer/Dropbox/JoP/Fig5_WHO.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/Fig5_WHO.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/Fig5_WHO.dta{rm}
saved
{p_end}

{com}. 
. 
. use "/Users/thomassommerer/Dropbox/JoP/Fig5_EU.dta", clear
{txt}
{com}. append using "/Users/thomassommerer/Dropbox/JoP/Fig5_IMF.dta" "/Users/thomassommerer/Dropbox/JoP/Fig5_NATO.dta"  "/Users/thomassommerer/Dropbox/JoP/Fig5_UN.dta" "/Users/thomassommerer/Dropbox/JoP/Fig5_WHO.dta"
{txt}
{com}. save "/Users/thomassommerer/Dropbox/JoP/Fig5_IO.dta", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/Fig5_IO.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
/Users/thomassommerer/Dropbox/JoP/Fig5_IO.dta{rm}
saved
{p_end}

{com}. 
. erase "/Users/thomassommerer/Dropbox/JoP/Fig5_EU.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/Fig5_IMF.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/Fig5_NATO.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/Fig5_UN.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/Fig5_WHO.dta"
{txt}
{com}. erase "/Users/thomassommerer/Dropbox/JoP/Fig5.dta"
{txt}
{com}. 
. 
. use "/Users/thomassommerer/Dropbox/JoP/Fig5_IO.dta", clear
{txt}
{com}. 
. gen IO=_n
{txt}
{com}. order IO
{txt}
{com}. 
. label define io 1 "EU" 2 "IMF" 3 "NATO" 4 "UN" 5 "WHO"
{txt}
{com}. label values IO io
{txt}
{com}. 
. rename IOmean1 IO_mean
{res}{txt}
{com}. rename IOmean2 IO_cilo
{res}{txt}
{com}. rename IOmean3 IO_cihi
{res}{txt}
{com}. 
. twoway (scatter IO_mean IO, mcolor(black) msize(medsmall) msymbol(circle)) (rspike IO_cil IO_cih IO, lcolor(black)) , ytitle(`"Very or fairly large consequences (in %)"') ytitle(, size(small)) yline(50, lwidth(thin) lpattern(dash) lcolor(gs8)) ylabel(0(25)100, labsize(small) angle(horizontal) nogrid) xscale(range(0 6)) xtitle(, size(zero)) xlabel(1(1)5, labsize(small) angle(horizontal) valuelabel nogrid) legend(off) plotregion(lcolor(black) )
{res}{txt}
{com}. 
. graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_5.gph", replace
{txt}{p 0 4 2}
(file {bf}
/Users/thomassommerer/Dropbox/JoP/Fig_5.gph{rm}
not found)
{p_end}
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_5.gph} saved

{com}.  
. 
.  
.  
.  
. ****************************************************************************************************
. ****************************************************************************************************
. *********** 4. Figures B.1-B.7 and Tables in Appendix                        *******************************
. ****************************************************************************************************
. ****************************************************************************************************
. 
.  
. 
. ****** Figure B.1 Effect of public opinion on support for IO reforms, relative frequencies
. 
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta", clear
{txt}
{com}.  
. 
. graph bar, over(q23_1_r, label(labcolor("black") angle(vertical) labsize(vsmall))) bar(1, fcolor(gs11) lcolor(gs11)) blabel(bar, size(vsmall) color(black) format(%3.2f)) ytitle(percent (%)) ytitle(, size(small) color(black)) ylabel(0(20)70, labsize(small) angle(horizontal) nogrid) by(, title(Support/oppose reforms to strengthen WHO: Resources, size(small) color(black)) note(`""', size(zero))) by(, graphregion(fcolor(white) lcolor(white)  ifcolor(white) ilcolor(white)) plotregion(lcolor(white))) by(exp_gr) subtitle(, size(small) color(black) fcolor(white) lcolor(white)) plotregion(lcolor(black))
{res}{txt}
{com}.  graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_B1_Resources.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_B1_Resources.gph} saved

{com}. 
. 
. 
. graph bar, over(q23_2_i, label(labcolor("black") angle(vertical) labsize(vsmall))) bar(1, fcolor(gs11) lcolor(gs11)) blabel(bar, size(vsmall) color(black) format(%3.2f)) ytitle(percent (%)) ytitle(, size(small) color(black)) ylabel(0(20)70, labsize(small) angle(horizontal) nogrid) by(, title(Support/oppose reforms to strengthen WHO: Independence, size(small) color(black)) note(`""', size(zero))) by(, graphregion(fcolor(white) lcolor(white)  ifcolor(white) ilcolor(white)) plotregion(lcolor(white))) by(exp_gr) subtitle(, size(small) color(black) fcolor(white) lcolor(white)) plotregion(lcolor(black))
{res}{txt}
{com}. graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_B1_Independence.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_B1_Independence.gph} saved

{com}. 
. 
. graph bar, over(q23_3_a, label(labcolor("black") angle(vertical) labsize(vsmall))) bar(1, fcolor(gs11) lcolor(gs11)) blabel(bar, size(vsmall) color(black) format(%3.2f)) ytitle(percent (%)) ytitle(, size(small) color(black)) ylabel(0(20)70, labsize(small) angle(horizontal) nogrid) by(, title(Support/oppose reforms to strengthen WHO: Authority, size(small) color(black)) note(`""', size(zero))) by(, graphregion(fcolor(white) lcolor(white)  ifcolor(white) ilcolor(white)) plotregion(lcolor(white))) by(exp_gr) subtitle(, size(small) color(black) fcolor(white) lcolor(white)) plotregion(lcolor(black))
{res}{txt}
{com}. graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_B1_Authority.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_B1_Authority.gph} saved

{com}. 
. 
. 
. 
. ****** Figure B.2 Pre-treatment attitudes toward international cooperation in the full sample of politicians and among national parliamentarians exclusively
. 
. graph bar, over(q16, label(labcolor("black") angle(horizontal) labsize(vsmall))) bar(1, fcolor(gs11) lcolor(gs11)) blabel(bar, size(vsmall) color(black) format(%3.2f)) ytitle(percent (%)) ytitle(, size(small) color(black)) ylabel(0(10)60, labsize(small) angle(horizontal) nogrid) title(Pre-treatment attitudes:  International cooperation a good instrument - All respondents, size(small) color(black)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) plotregion(lcolor(black))
{res}{txt}
{com}.  graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_B2_all.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_B2_all.gph} saved

{com}. 
. 
. 
. 
. graph bar if riksdag==1, over(q16, label(labcolor("black") angle(horizontal) labsize(vsmall))) bar(1, fcolor(gs11) lcolor(gs11)) blabel(bar, size(vsmall) color(black) format(%3.2f)) ytitle(percent (%)) ytitle(, size(small) color(black)) ylabel(0(10)60, labsize(small) angle(horizontal) nogrid) title(Pre-treatment attitudes:  International cooperation a good instrument - Parliamentarians, size(small) color(black)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) plotregion(lcolor(black))
{res}{txt}
{com}.  graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_B2_parliamentarians.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_B2_parliamentarians.gph} saved

{com}. 
. 
. 
. *******  Figure B.3 Pre-treatment attitudes toward the WHO in the full sample of politicians and among national parliamentarians exclusively
. 
. 
. graph bar, over(q18, label(labcolor("black") angle(horizontal) labsize(vsmall))) bar(1, fcolor(gs11) lcolor(gs11)) blabel(bar, size(vsmall) color(black) format(%3.2f)) ytitle(percent (%)) ytitle(, size(small) color(black)) ylabel(0(10)60, labsize(small) angle(horizontal) nogrid) title(Pre-treatment attititudes: Confidence in WHO- All Respondents, size(small) color(black)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) plotregion(lcolor(black))
{res}{txt}
{com}.  graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_B3_all.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_B3_all.gph} saved

{com}. 
. graph bar if riksdag==1, over(q18, label(labcolor("black") angle(horizontal) labsize(vsmall))) bar(1, fcolor(gs11) lcolor(gs11)) blabel(bar, size(vsmall) color(black) format(%3.2f)) ytitle(percent (%)) ytitle(, size(small) color(black)) ylabel(0(10)60, labsize(small) angle(horizontal) nogrid) title(Pre-treatment attititudes: Confidence in WHO - Parliamentarians, size(small) color(black)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) plotregion(lcolor(black))
{res}{txt}
{com}.  graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_B3_parliamentarians.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_B3_parliamentarians.gph} saved

{com}. 
. 
. 
.  
. **** Figure B4: Effect of public opinion on support for IO reforms (composite index) *******************************************
. 
. 
. 
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_ttest.dta", clear
{txt}
{com}. 
. 
. twoway (scatter Index_mean treatment, mcolor(black) msize(medsmall) msymbol(circle)) (rspike Index_cilo Index_cihi treatment, lcolor(black)) if id>0 & id<3,  ytitle(, size(zero)) yline(2 3 4, lwidth(thin) lpattern(solid) lcolor(gs8)) ylabel(2(1)4, labsize(medsmall) angle(horizontal) valuelabel) xtitle(, size(zero))  xscale(range(0.5 2.5)) xlabel(1(1)2, labsize(medsmall) angle(vertical) valuelabel) title(`"Composite index"', size(medium) color(black)) legend(off) xsize(2.5) ysize(5) plotregion(lcolor(black))
{res}{txt}
{com}. 
.  graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_B4.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_B4.gph} saved

{com}. 
.  
.  
. *** Figure B5 Effect of public opinion on support for IO reforms, by level of pre-treatment attitudes toward international cooperation ***********
. 
. *** Authority 
. 
. twoway (scatter Auth_mean treatment, mcolor(black) msize(medlarge) msymbol(circle)) (rspike Auth_cilo Auth_cihi treatment, lcolor(black))if id>12 & id<19, ytitle(, size(zero)) yline(2 3 4, lwidth(thin) lpattern(solid) lcolor(gs8)) ylabel(2(1)4, labsize(small) angle(horizontal) valuelabel) xtitle(, size(zero))  xscale(range(0.5 2.5)) xlabel(1(1)2, labsize(small) angle(vertical) valuelabel) by(, title(`"Authority"', size(medsmall) color(black)) note(`""', size(zero))) by(, legend(off)) by(, graphregion(fcolor(white) lcolor(white))) by(subgroup, cols(3)) subtitle(, fcolor(white) size(small)lcolor(white)) xsize(5.5) ysize(4) plotregion(lcolor(black))
{res}{txt}
{com}. 
. graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_B5a.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_B5a.gph} saved

{com}. 
. *** Resources
. 
. twoway (scatter Res_mean treatment, mcolor(black) msize(medlarge) msymbol(circle)) (rspike Res_cilo Res_cihi treatment, lcolor(black))if id>12 & id<19, ytitle(, size(zero)) yline(2 3 4, lwidth(thin) lpattern(solid) lcolor(gs8)) ylabel(2(1)4, labsize(small) angle(horizontal) valuelabel) xtitle(, size(zero))  xscale(range(0.5 2.5)) xlabel(1(1)2, labsize(small) angle(vertical) valuelabel) by(, title(`"Resources"', size(medsmall) color(black)) note(`""', size(zero))) by(, legend(off)) by(, graphregion(fcolor(white) lcolor(white))) by(subgroup, cols(3)) subtitle(, fcolor(white) size(small)lcolor(white)) xsize(5.5) ysize(4) plotregion(lcolor(black))
{res}{txt}
{com}. 
. graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_B5b.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_B5b.gph} saved

{com}. 
. *** Independence
. 
. twoway (scatter Indep_mean treatment, mcolor(black) msize(medlarge) msymbol(circle)) (rspike Indep_cilo Indep_cihi treatment, lcolor(black))if id>12 & id<19, ytitle(, size(zero)) yline(2 3 4, lwidth(thin) lpattern(solid) lcolor(gs8)) ylabel(2(1)4, labsize(small) angle(horizontal) valuelabel) xtitle(, size(zero))  xscale(range(0.5 2.5)) xlabel(1(1)2, labsize(small) angle(vertical) valuelabel) by(, title(`"Independence"', size(medsmall) color(black)) note(`""', size(zero))) by(, legend(off)) by(, graphregion(fcolor(white) lcolor(white))) by(subgroup, cols(3)) subtitle(, fcolor(white) size(small)lcolor(white)) xsize(5.5) ysize(4) plotregion(lcolor(black))
{res}{txt}
{com}. 
. graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_B5c.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_B5c.gph} saved

{com}. 
.  
.  
.  
.  
. ***** Figure B.6
. 
. 
. use "/Users/thomassommerer/Dropbox/JoP/EffectsofLegitimacy_data.dta", clear
{txt}
{com}.  
. 
. *** Public opinion against growing power of IO
. 
. graph bar, over(q29_1, label(labcolor("black") angle(horizontal) labsize(small))) bar(1, fcolor(black) lcolor(black)) blabel(bar, size(vsmall) color(black) format(%3.2f)) ytitle(Percentage (%)) ytitle(, size(small) color(black)) ylabel(0(10)60, labsize(small) angle(horizontal) nogrid) title(More difficult for government to get support in other fields of foreign policy, size(small) color(black)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) plotregion(lcolor(black))
{res}{txt}
{com}. graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_B6a.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_B6a.gph} saved

{com}. 
. graph bar, over(q29_2, label(labcolor("black") angle(horizontal) labsize(small))) bar(1, fcolor(black) lcolor(black)) blabel(bar, size(vsmall) color(black) format(%3.2f)) ytitle(Percentage (%)) ytitle(, size(small) color(black)) ylabel(0(10)60, labsize(small) angle(horizontal) nogrid) title(More difficult for government to get support on domestic issues, size(small) color(black)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) plotregion(lcolor(black))
{res}{txt}
{com}. graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_B6b.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_B6b.gph} saved

{com}. 
. graph bar, over(q29_3, label(labcolor("black") angle(horizontal) labsize(small))) bar(1, fcolor(black) lcolor(black)) blabel(bar, size(vsmall) color(black) format(%3.2f)) ytitle(Percentage (%)) ytitle(, size(small) color(black)) ylabel(0(10)60, labsize(small) angle(horizontal) nogrid) title(More difficult for government to get unity in parliament on foreign policy, size(small) color(black)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) plotregion(lcolor(black))
{res}{txt}
{com}. graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_B6c.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_B6c.gph} saved

{com}. 
. graph bar, over(q29_4, label(labcolor("black") angle(horizontal) labsize(small))) bar(1, fcolor(black) lcolor(black)) blabel(bar, size(vsmall) color(black) format(%3.2f)) ytitle(Percentage (%)) ytitle(, size(small) color(black)) ylabel(0(10)60, labsize(small) angle(horizontal) nogrid) title(Government would loose support in polls, size(small) color(black)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) plotregion(lcolor(black))
{res}{txt}
{com}. graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_B6d.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_B6d.gph} saved

{com}. 
. **** Public opinion in favour of growing power of IO
. 
. graph bar, over(q31_1, label(labcolor("black") angle(horizontal) labsize(small))) bar(1, fcolor(gs12) lcolor(gs12)) blabel(bar, size(vsmall) color(black) format(%3.2f)) ytitle(Percentage (%)) ytitle(, size(small) color(black)) ylabel(0(10)60, labsize(small) angle(horizontal) nogrid) title(More difficult for government to get support in other fields of foreign policy, size(small) color(black)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) plotregion(lcolor(gs12)) xsize(4.5) ysize(5.5)
{res}{txt}
{com}. graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_B6e.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_B6e.gph} saved

{com}. 
. graph bar, over(q31_2, label(labcolor("black") angle(horizontal) labsize(small))) bar(1, fcolor(gs12) lcolor(gs12)) blabel(bar, size(vsmall) color(black) format(%3.2f)) ytitle(Percentage (%)) ytitle(, size(small) color(black)) ylabel(0(10)60, labsize(small) angle(horizontal) nogrid) title(More difficult for government to get support on domestic issues, size(small) color(black)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) plotregion(lcolor(gs12))
{res}{txt}
{com}. graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_B6f.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_B6f.gph} saved

{com}. 
. graph bar, over(q31_3, label(labcolor("black") angle(horizontal) labsize(small))) bar(1, fcolor(gs12) lcolor(gs12)) blabel(bar, size(vsmall) color(black) format(%3.2f)) ytitle(Percentage (%)) ytitle(, size(small) color(black)) ylabel(0(10)60, labsize(small) angle(horizontal) nogrid) title(More difficult for government to get unity in parliament on foreign policy, size(small) color(black)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) plotregion(lcolor(gs12))
{res}{txt}
{com}. graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_B6g.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_B6g.gph} saved

{com}. 
. graph bar, over(q31_4, label(labcolor("black") angle(horizontal) labsize(small))) bar(1, fcolor(gs12) lcolor(gs12)) blabel(bar, size(vsmall) color(black) format(%3.2f)) ytitle(Percentage (%)) ytitle(, size(small) color(black)) ylabel(0(10)60, labsize(small) angle(horizontal) nogrid) title(Government would loose support in polls, size(small) color(black)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) plotregion(lcolor(gs12))
{res}{txt}
{com}. graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_B6h.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_B6h.gph} saved

{com}. 
. 
.  ***
.  
.  **** Figure B.7 
. 
. ******* Consequences of going against public opinion: ....5 IOs
. 
. graph bar, over(q33_1, label(labcolor("black") angle(vertical) labsize(small))) bar(1, fcolor(black) lcolor(black)) blabel(bar, size(vsmall) color(black) format(%3.2f)) ytitle(Percentage (%)) ytitle(, size(small) color(black)) ylabel(0(10)60, labsize(small) angle(horizontal) nogrid) title(Consequences of going against public opinion: EU, size(small) color(black)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) plotregion(lcolor(black))
{res}{txt}
{com}. graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_B7_EU.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_B7_EU.gph} saved

{com}. 
. graph bar, over(q33_2, label(labcolor("black") angle(vertical) labsize(small))) bar(1, fcolor(black) lcolor(black)) blabel(bar, size(vsmall) color(black) format(%3.2f)) ytitle(Percentage (%)) ytitle(, size(small) color(black)) ylabel(0(10)60, labsize(small) angle(horizontal) nogrid) title(Consequences of going against public opinion: UN, size(small) color(black)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) plotregion(lcolor(black))
{res}{txt}
{com}. graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_B7_UN.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_B7_UN.gph} saved

{com}. 
. graph bar, over(q33_3, label(labcolor("black") angle(vertical) labsize(small))) bar(1, fcolor(black) lcolor(black)) blabel(bar, size(vsmall) color(black) format(%3.2f)) ytitle(Percentage (%)) ytitle(, size(small) color(black)) ylabel(0(10)60, labsize(small) angle(horizontal) nogrid) title(Consequences of going against public opinion: IMF, size(small) color(black)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) plotregion(lcolor(black))
{res}{txt}
{com}. graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_B7_IMF.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_B7_IMF.gph} saved

{com}. 
. graph bar, over(q33_4, label(labcolor("black") angle(vertical) labsize(small))) bar(1, fcolor(black) lcolor(black)) blabel(bar, size(vsmall) color(black) format(%3.2f)) ytitle(Percentage (%)) ytitle(, size(small) color(black)) ylabel(0(10)60, labsize(small) angle(horizontal) nogrid) title(Consequences of going against public opinion: NATO, size(small) color(black)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) plotregion(lcolor(black))
{res}{txt}
{com}. graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_B7_NATO.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_B7_NATO.gph} saved

{com}. 
. graph bar, over(q33_5, label(labcolor("black") angle(vertical) labsize(small))) bar(1, fcolor(black) lcolor(black)) blabel(bar, size(vsmall) color(black) format(%3.2f)) ytitle(Percentage (%)) ytitle(, size(small) color(black)) ylabel(0(10)60, labsize(small) angle(horizontal) nogrid) title(Consequences of going against public opinion: WHO, size(small) color(black)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) plotregion(lcolor(black))
{res}{txt}
{com}. graph save "Graph" "/Users/thomassommerer/Dropbox/JoP/Fig_B7_WHO.gph"
{res}{txt}file {bf:/Users/thomassommerer/Dropbox/JoP/Fig_B7_WHO.gph} saved

{com}. 
. 
. 
.  
.  
.  
. ******  Table B.1 Sample descriptives
. 
. tab polexp

         {txt}Political {c |}
     experience in {c |}
   years (elected) {c |}      Freq.     Percent        Cum.
{hline 19}{c +}{hline 35}
Less than 10 years {c |}{res}        243       18.54       18.54
{txt}       10-19 years {c |}{res}        400       30.51       49.05
{txt}       20-29 years {c |}{res}        287       21.89       70.94
{txt}  30 years or more {c |}{res}        381       29.06      100.00
{txt}{hline 19}{c +}{hline 35}
             Total {c |}{res}      1,311      100.00
{txt}
{com}. tab age

        {txt}Age {c |}
categorical {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
   Under 40 {c |}{res}         81        6.10        6.10
{txt}      40-49 {c |}{res}        149       11.23       17.33
{txt}      50-59 {c |}{res}        246       18.54       35.87
{txt} 60 or more {c |}{res}        851       64.13      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      1,327      100.00
{txt}
{com}. tab sex

          {txt}Sex {c |}      Freq.     Percent        Cum.
{hline 14}{c +}{hline 35}
          Man {c |}{res}        876       66.36       66.36
{txt}        Woman {c |}{res}        444       33.64      100.00
{txt}{hline 14}{c +}{hline 35}
        Total {c |}{res}      1,320      100.00
{txt}
{com}. tab education

                   {txt}Education (cat) {c |}      Freq.     Percent        Cum.
{hline 35}{c +}{hline 35}
    Upper secondary school or less {c |}{res}        295       22.26       22.26
{txt}Tertiary education, not university {c |}{res}        163       12.30       34.57
{txt}                        University {c |}{res}        814       61.43       96.00
{txt}                               PhD {c |}{res}         53        4.00      100.00
{txt}{hline 35}{c +}{hline 35}
                             Total {c |}{res}      1,325      100.00
{txt}
{com}. tab bcountry

      {txt}Birth {c |}
    country {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
     Sweden {c |}{res}      1,262       94.89       94.89
{txt}     Abroad {c |}{res}         68        5.11      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      1,330      100.00
{txt}
{com}. tab politician_cat1822

  {txt}Category of {c |}
   politician {c |}
    2018-2022 {c |}      Freq.     Percent        Cum.
{hline 14}{c +}{hline 35}
Not disclosed {c |}{res}        113        8.48        8.48
{txt}        Nämnd {c |}{res}        207       15.53       24.01
{txt}        Local {c |}{res}        712       53.41       77.42
{txt}       Region {c |}{res}        229       17.18       94.60
{txt}   Parliament {c |}{res}         72        5.40      100.00
{txt}{hline 14}{c +}{hline 35}
        Total {c |}{res}      1,333      100.00
{txt}
{com}. 
. ******* Table B.2  Response time for survey questions (in seconds)
. 
. * Support or oppose reforms to strenghten WHO *
. 
. sum t_q*

{txt}    Variable {c |}        Obs        Mean    Std. dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 5}t_q17_1 {c |}{res}      1,331     18.2038    33.00541          0     596.18
{txt}{space 5}t_q17_2 {c |}{res}      1,331    19.53649    33.62232          0     596.18
{txt}{space 5}t_q17_3 {c |}{res}      1,331    22.14291    38.07688      3.014    653.631
{txt}{space 5}t_q17_4 {c |}{res}      1,331    1.205109    .7847251          0         14
{txt}{space 5}t_q19_1 {c |}{res}      1,331    5.607024    13.89585          0    444.938
{txt}{hline 13}{c +}{hline 57}
{space 5}t_q19_2 {c |}{res}      1,331    5.853175    14.00552          0    444.938
{txt}{space 5}t_q19_3 {c |}{res}      1,331    7.327023    14.18326      1.281    445.897
{txt}{space 5}t_q19_4 {c |}{res}      1,331    1.111946    .4286016          0          7
{txt}{space 5}t_q24_1 {c |}{res}      1,322    40.47063    98.44581       .546    2315.44
{txt}{space 5}t_q24_2 {c |}{res}      1,322    81.71523    113.0025      4.197    2316.85
{txt}{hline 13}{c +}{hline 57}
{space 5}t_q24_3 {c |}{res}      1,322    83.88819    113.0699      4.922    2318.21
{txt}{space 5}t_q24_4 {c |}{res}      1,322    7.295764    5.971251          1         82
{txt}{space 5}t_q28_1 {c |}{res}      1,319     23.0308    30.21222          0    497.249
{txt}{space 5}t_q28_2 {c |}{res}      1,319    24.54736    31.21216          0    497.249
{txt}{space 5}t_q28_3 {c |}{res}      1,319    26.55874    31.39918      2.013     498.43
{txt}{hline 13}{c +}{hline 57}
{space 5}t_q28_4 {c |}{res}      1,319    1.300986      1.9249          0         59
{txt}{space 5}t_q30_1 {c |}{res}      1,316      26.342    72.34558          0   1745.479
{txt}{space 5}t_q30_2 {c |}{res}      1,316    59.29556    93.54379          0    1756.91
{txt}{space 5}t_q30_3 {c |}{res}      1,316    61.39172    93.67393      10.98   1758.973
{txt}{space 5}t_q30_4 {c |}{res}      1,316    6.221884    3.349276          0         56
{txt}
{com}. 
. 
. 
. *** Table B.3 Bivariate correlation IO basic capabilities (Pearsons r)
. 
. pwcorr q23_1_r q23_2 q23_3

             {txt}{c |} q23_1_~s q23_2_~p q23_3_~h
{hline 13}{c +}{hline 27}
q23_1_reso~s {c |} {res}  1.0000 
 {txt}q23_2_indep {c |} {res}  0.5036   1.0000 
  {txt}q23_3_auth {c |} {res}  0.5662   0.4551   1.0000 
{txt}
{com}. 
. 
.  
. 
{txt}end of do-file

{com}. log close
      {txt}name:  {res}<unnamed>
       {txt}log:  {res}/Users/thomassommerer/Dropbox/JoP/Effects_of_legitimacy_log.smcl
  {txt}log type:  {res}smcl
 {txt}closed on:  {res} 4 Dec 2024, 09:30:50
{txt}{.-}
{smcl}
{txt}{sf}{ul off}